<template>
	<view>
		<view class="grid" style="width: 90%;margin: 15rpx auto;">
			<view v-for="(item,index) in medal" :key="index">
				<view class="" style="display: flex;flex-wrap: wrap;justify-content: center;">
					<image style="width: 80%;" :src="baseUrl+item.iconPath" mode="widthFix"></image>
					<text>{{item.medalName}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				baseUrl:'http://127.0.0.1:8081/',
				medal:[]
			}
		},
		onLoad() {
			this.getmela()
		},
		methods: {
			async getmela(){
				const data=await this.$request.getmedal()
				console.log(data)
				this.medal=data.data.data
			},
		}
	}
</script>

<style>
	.grid{
		display: grid;
		grid-template-columns: 1fr 1fr 1fr;
	}

</style>
